feat(core): support glm-5.3-flash under glm-v family - #3071
Conversation
GLM-5.3-Flash is an always-thinking vision model: it rejects thinking.type=disabled with error 1210, so the glm-v adapter now branches on the resolved model name. For glm-5.3-flash it keeps thinking enabled (clear_thinking=false), steers depth via reasoning_effort (low when the user disables reasoning), and applies the officially recommended temperature=1 / top_p=0.95 defaults. Other glm-v models keep the toggleable-thinking contract unchanged. Field-tested against the Zhipu Coding Plan endpoint in KSL-49: same-sample accuracy on par with the production vision models (qwen3.8-max / MiniMax-M3), locate IoU 0.698 with the glm-v 0-1000 bbox contract. The model catalog docs (en/zh) list glm-5.3-flash under glm-v with the always-thinking note. Co-authored-by: jzli <jzli@alauda.io> Co-authored-by: multica-agent <github@multica.ai>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7cc20fcb6a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } else if (userConfig.reasoningEffort) { | ||
| modelSpecificConfig.reasoning_effort = userConfig.reasoningEffort; |
There was a problem hiding this comment.
Avoid overriding effort in default reasoning mode
When a GLM-5.3 user sets MIDSCENE_MODEL_REASONING_ENABLED=default together with MIDSCENE_MODEL_REASONING_EFFORT, this branch still emits reasoning_effort. This violates the unified contract documented in apps/site/docs/en/model-config.mdx:88, where default follows provider behavior and ignores explicit effort settings, so users selecting that mode unexpectedly continue overriding the provider default.
Useful? React with 👍 / 👎.
| modelSpecificConfig.reasoning_effort = | ||
| userConfig.reasoningEffort ?? 'low'; |
There was a problem hiding this comment.
Preserve normal effort when reasoning is enabled
When reasoningEnabled is explicitly true and no effort is supplied, this expression assigns low, just as it does for the disable case. The intended substitution described above is specifically for a no-reasoning request on an always-thinking model; applying it to users who force-enable reasoning silently minimizes reasoning and can reduce task accuracy. Use low only for the disabled/unset path and preserve the provider's effort default when reasoning is explicitly enabled.
Useful? React with 👍 / 👎.
|
|
||
| | Model version | Commonly used model names | `MIDSCENE_MODEL_FAMILY` | Notes | | ||
| | --- | --- | --- | --- | | ||
| | GLM-5.3 series | `glm-5.3-flash` | `glm-v` | Always-thinking: `thinking.type` cannot be disabled, so disabling reasoning sends `reasoning_effort: low` instead. | |
There was a problem hiding this comment.
Document GLM-5.3 reasoning-effort support
The adapter now consumes MIDSCENE_MODEL_REASONING_EFFORT for GLM-5.3-Flash, but the authoritative supported-family list in apps/site/docs/{en,zh}/model-config.mdx still omits GLM and says only the listed families support this setting. Users therefore cannot discover the knob that the implementation and this new row rely on; add GLM-5.3-Flash to both language versions of that list. apps/site/agents.mdL5-L5
Useful? React with 👍 / 👎.
…tract Address review feedback on web-infra-dev#3071: - reasoningEnabled=default no longer forwards reasoning_effort; the default mode follows provider behavior and ignores explicit effort settings, as documented in model-config.mdx. - A 'low' effort is now applied only for the no-reasoning intent (explicit false or unset); explicitly enabling reasoning without an effort keeps the provider default instead of silently minimizing reasoning. - List Zhipu GLM (glm-5.3-flash) in the MIDSCENE_MODEL_REASONING_EFFORT supported families in both en/zh model-config.mdx. - Cover both behavior changes with unit tests.
|
Thanks for the review — all three points are addressed in 19be45c:
Both behavior changes are covered by new unit tests ( @codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
feat(core): support glm-5.3-flash under glm-v family
Summary
GLM-5.3-Flash is an always-thinking vision model: it rejects
thinking.type: 'disabled'with error1210("该模型始终思考,不支持关闭思考"),so the existing glm-v adapter contract does not fit it.
This PR branches the glm-v chat-completion parameter builder on the resolved
model name:
glm-5.3-flash(matched by/^glm-5\.3-flash\b/):clear_thinking: falsereasoning_effort(defaults tolowwhen the userdisables reasoning, since thinking cannot be turned off)
temperature: 1,top_p: 0.95(https://docs.bigmodel.cn/cn/guide/models/vlm/glm-5.3-flash)
unchanged.
To support the branching,
ChatCompletionCallInput/ChatCompletionCallContextgain an optionalmodelName, andcallAIpassesmodelConfig.modelNamethrough.Changes
packages/core/src/ai-model/models/glm.ts— always-thinking branchpackages/core/src/ai-model/model-adapter/types.ts— optionalmodelNamepackages/core/src/ai-model/service-caller/index.ts— passmodelNamepackages/core/tests/unit-test/model-adapter/glm.test.ts— new unit testsapps/site/docs/{en,zh}/model-common-config.mdx— list glm-5.3-flash underglm-v with an always-thinking note
Verification
Field-tested against the Zhipu (BigModel) Coding Plan endpoint on 2026-08-26
(KSL-49 spike) and re-verified on 2026-08-31 in a production Android-automation
setup driving real devices through
agentFromAdbDevice:glm-5.3-flashwith the patched parameters returns HTTP 200 and completesreal
aiActtasks on physical Android devices (e.g. "open the Settings app"reliably launches
com.android.settings).(qwen3.8-max / MiniMax-M3); locate IoU 0.698 with the glm-v 0-1000 bbox
contract on a UI-screenshot benchmark.
thinking.type: 'disabled'is confirmed rejected by the endpoint with error1210, which is why the adapter keeps thinking enabled for this model.
toggleable-thinking behavior of other glm-v models.